package com.yt.order.api.client;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yt.common.constant.Result;
import com.yt.common.enums.CodeEnum;
import com.yt.order.models.vo.AreasVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;
import com.yt.order.models.service.IAreasService;
import com.yt.order.models.bo.AreasBO;
import com.yt.order.models.dto.AreasDTO;

import java.util.List;

/**
 * 地理选区控制器
 *
 * @author zhou
 * @Date 2025-09-23 16:56:46
 */

@RestController
@RequestMapping("/api/areas")
@Slf4j
@Api(value = "AreasApiController",tags = "地理选区Api接口")
public class AreasApiController {

    @DubboReference
    private IAreasService areasService;

    @ApiOperation(value = "获取地区树形结构", notes = "获取完整的省市区树形结构")
    @PostMapping("/tree")
    public Result<List<AreasVO>> getAreaTree() {
        List<AreasVO> tree = areasService.getAreaTree();
        return new Result<>(tree);
    }
}
